import { getStorage } from "../../utils/storage";
export default {
  namespaced: true,
  state: {
    goodsLength: 0,
  },

  mutations: {
    getGoodsLength(state) {
      state.goodsLength = 0;
      let shopCarList = getStorage("shopCarList")
        ? getStorage("shopCarList")
        : 0;
      if (shopCarList.length) {
        shopCarList.forEach((item) => {
          state.goodsLength += item.num;
        });
      }
    },
  },
};
